# 代码结果：
    # ['Part A', 'Part B', 'Part C']

from abc import ABC, abstractmethod

# 定义产品类
class Product:
    def __init__(self):
       self.parts = []

    def add_part(self, part):
       self.parts.append(part)

    def get_result(self):
       return self.parts

# 定义建造者接口
class Builder(ABC):
    @abstractmethod
    def build_part_a(self):
        pass

    @abstractmethod
    def build_part_b(self):
        pass

    @abstractmethod
    def build_part_c(self):
        pass

    @abstractmethod
    def get_result(self):
        pass

# 具体建造者类
class ConcreteBuilder(Builder):
    def __init__(self):
       self.product = Product()

    def build_part_a(self):
       self.product.add_part("Part A")

    def build_part_b(self):
       self.product.add_part("Part B")

    def build_part_c(self):
       self.product.add_part("Part C")

    def get_result(self):
       return self.product

# 指挥者类
class Director:
    def __init__(self, builder: Builder):
       self.builder = builder

    def construct(self):
       self.builder.build_part_a()
       self.builder.build_part_b()
       self.builder.build_part_c()
       return self.builder.get_result()

# 客户端代码
if __name__ == "__main__":
    builder = ConcreteBuilder()
    director = Director(builder)
    product = director.construct()
    print(product.get_result())